﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TemplateLibraryConnector.Utility;

namespace TemplateLibraryConnector.Data
{
    public static class TemplateLibraryFactory
    {
        public static BaseTemplates GetTemplates(TemplateViewType view, TemplateLibrarySettings settings)
        {
            BaseTemplates myBase = null;
            switch (view)
            { 
                case TemplateViewType.All:
                    myBase = new AllTemplates(settings);
                    break;
                case TemplateViewType.Favorites:
                    myBase = new FavoriteTemplates(settings);
                    break;
                case TemplateViewType.LastUsed:
                    myBase = new LastUsedTemplates(settings);
                    break;
                default:
                    throw new ArgumentException(string.Format("Template view type is not recognized: {0}", Enum.GetName(typeof(TemplateViewType), view)));
            }
            return myBase;
        }
    }
}
